package com.vpx.server.mapper.system;

import com.vpx.server.bean.entity.SysUserRole;
import com.vpx.server.framework.base.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author liuks
 * @title: vpx
 * @module: 用户角色
 * @description: 用户角色Mapper
 * @date 2021/09/11 20:18
 */
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {

    /**
     * 根据用户id查询所有用户角色
     * @param userId
     * @return
     */
    @Select("select * from sys_user_role where user_id = #{userId}")
    List<SysUserRole> querySysUserRoleByUserId(@Param("userId") Long userId);

    /**
     * 根据用户id删除用户角色
     * @param userId
     * @return
     */
    @Delete("delete from sys_user_role where user_id = #{userId}")
    int deleteSysUserRoleByUserId(@Param("userId") Long userId);
}
